package com.neusoft.nepm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.neusoft.nepm.mapper.AqiMapper;
import com.neusoft.nepm.po.Aqi;
import com.neusoft.nepm.service.IAqiService;
import com.neusoft.nepm.vo.ResponseData;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zouran
 * createDate：2023/6/19  15:47
 */
@Service
public class AqiServiceImpl implements IAqiService {
    @Resource
    private AqiMapper mapper;
    //查询aqi等级
    @Override
    public ResponseData<List<Aqi>> listAqiAll() {
        ResponseData data = new ResponseData<>();

        QueryWrapper<Aqi> qw = new QueryWrapper<>();
        //查询时按照id排序
        qw.orderByAsc("aqi_id");
        List<Aqi> list = mapper.selectList(qw);
        data.setCode(200);
        data.setResult(list);
        return data;
    }
}
